import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import NotFound from '../views/NotFound.vue'
import Index from '../views/index.vue'

const routes = [
	{
		path: '/',
		name: 'login',
		component: Login,
	},
	{
		path: '/home',
		name: 'home',
		component: Home,
		redirect: '/index',
		children: [
			{
				name: 'index',
				path:'/index',
				component: Index,
			},
		],
	},
	//放在最下面, 将匹配所有内容并将其放在 `$route.params.pathMatch` 下
	// {
	// 	path: '/:pathMatch(.*)*',
	// 	component: NotFound,
	// },
]

const router = createRouter({
	history: createWebHistory(),
	routes,
})

export default router
